<?php if(isset($paginator)) { ?>
<div class="pagination pagination-small pagination-centered">
    <ul>
	<?php
	if (!empty($_param_pagination)) {
		$param = null;

		foreach($_param_pagination as $k=>$v) {
			$param[$k] = urlencode($v);
		}

        $paginator->options(
            array(
                'url' => $param
            )
        );
    }

	$_pPagination = $paginator->params();

	if($_pPagination['pageCount'] > 1) {

		if($_pPagination['page'] > 1 ) {
			echo $paginator->first('<<', array('tag'=>'li','escape' => false, 'class'=>'prev'));
			echo $paginator->prev('<', array('tag'=>'li','escape' => false, 'class'=>'prev'));
		}

		for ($i = 1; $i <= $_pPagination['pageCount']; $i++) {
			if ($i == $_pPagination['page']) {
				echo '<li class="active"><span>'.$i.'</span></li>';
			}
			else {
				if ($i > ($_pPagination['page'] - 3) && $i < ($_pPagination['page'] + 3)) {
					echo '<li>'.$this->Paginator->link($i, array('page' => $i)).'</li>';
				}
			}
		}

		if($_pPagination['page'] < $_pPagination['pageCount']) {
			echo $paginator->next('>',array('tag'=>'li','escape' => false, 'class'=>'next'));
			echo $paginator->last('>>',array('tag'=>'li','escape' => false, 'class'=>'next'));
		}
	}
	?>
        </ul>
</div>
<?php } ?>